package com.laicunba.service.mq;

import java.util.List;
import java.util.Map;

import javax.jms.Message;
import javax.jms.Session;

public interface ActiveMQService {
	public interface ListenCallBack {
		String receive(Message msg);
	}

	boolean sendTopics(String topics, String msg);

	/**
	 * 发送队列消息
	 * 
	 * @param name
	 * @param msg
	 * @param tid
	 *            分步式事务ID
	 * @return
	 */
	boolean sendQueues(String name, String msg, String tid);

	boolean listenTopic(String processId, String topic, ListenCallBack listenCallBack);

	boolean stopListen(String processId);

	boolean listenQueue(String processId, String queue, ListenCallBack listenCallBack);

	Map<String,Session> getAllSession();

}
